{template 'public/header'}

{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/yzzc_sun/template/public/ygcsslist.css">
<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>
    <li  {if $type=='all'} class="active" {/if}><a href="{php echo $this->createWebUrl('ordertime',array('type'=>all,'carnum'=>$carnum,'status'=>1));}">全部时间</a></li>

</ul>

<div class="row ygrow">
    <div class='col-lg-12'>
        <a data-toggle="modal" data-target="#myModalsss"><button class="btn btn-xs storeblue">预定下单</button></a>
        <div class="modal fade" id="myModalsss" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
          <div class="modal-dialog" role="document">
                <div class="modal-content">
                  <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">新增预定</h4>
                  </div>
                  <form action="" method="get" >
                      <input type="hidden" name="c" value="site" />
                      <input type="hidden" name="a" value="entry" />
                      <input type="hidden" name="m" value="yzzc_sun" />
                      <input type="hidden" name="do" value="ordertime" />
                      <input type="hidden" name="op" value="add" />
                      <div class="modal-body" style="font-size: 20px">
                          <div class="form-group">
                              <label class="col-xs-12 col-sm-3 col-md-2 control-label">选择车牌号</label>
                              <div class="col-sm-9">
                                  <select name="sku_id" >
                                      {loop $sku $index $item}
                                      <option value="{$item['id']}">{$item['carnum']}</option>
                                      {/loop}
                                  </select>
                              </div>
                          </div>
                          <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">开始时间</label>
                            <div class="col-sm-9">
                                {php echo tpl_form_field_date('start_time','',true)}
                            </div>
                          </div>
                          <div class="form-group">
                            <label class="col-xs-12 col-sm-3 col-md-2 control-label">结束时间</label>
                            <div class="col-sm-9">
                                {php echo tpl_form_field_date('end_time','',true)}
                            </div>
                          </div>
                          <div class="form-group">
                          <label class="col-xs-12 col-sm-3 col-md-2 control-label">备注</label>
                          <div class="col-sm-9">
                              <textarea name="remark" class="form-control" cols="30" rows="7"></textarea>
                          </div>
                          </div>
                      </div>

                      <div class="modal-footer">
                          <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                          <input type="submit" class="btn btn-info" name="submit" value="确定"/>
                      </div>
                      <input type="hidden" name="token" value="{$_W['token']}"/>
                  </form>
                </div>
              </div>
          </div>
    </div>
</div>

<div class="main ">
    <div class="panel panel-default">

    </div>
    <div class="panel panel-default">
        <div class="panel-heading">
           {$carname['name']} --- 订单列表
        </div>
        <div class="panel-body" style="padding: 0px 15px;">
            <div class="row">
                <table class="yg5_tabel col-md-12">
                    <tr class="yg5_tr1">
                        <!--<td class="store_td1 col-md-1" style="text-align: center;">-->
                            <!--<input type="checkbox" class="allcheck" />-->
                            <!--<span class="store_inp">全选</span>-->
                        <!--</td>-->
<!--                        <td class=" col-md-1">id</td>-->
                        <td class="store_td1 col-md-1">租车开始时间</td>
                        <td class="col-md-1">租车结束时间</td>
<!--                        <td class="col-md-1">天数</td>-->
                        <td class="col-md-1">车牌号</td>
<!--                        <td class="col-md-1">取车名称/手机</td>-->
                        <td class="col-md-1">类型</td>
                        <td class="col-md-1">备注</td>

                        <td class="col-md-1">操作</td>
                    </tr>
                    {loop $list $key $item}
                    <tr class="yg5_tr2">
                        <!--<td>-->
                            <!--<input type="checkbox" name="test" value="{$item['id']}">-->
                        <!--</td>-->
<!--                        <td>{$item['id']}</td>-->
                        <td>{$item['start_time']}</td>
                        <td>{$item['end_time']}</td>
<!--                         <td>{$item['order']['day']}</td>-->
                        <td>{$item['carnum']}</td>
<!--                        <td>{$item['order']['createtime']}</td>-->
<!--                        <td>{$item['order']['paytime']}</td>-->
<!--                        <td>{$item['order']['username']}/{$item['order']['tel']}</td>-->
                        <td>
                        {if $item['order_id']==0}
                            <span class="label store-yellow btn">预订下单</span>
                        {else}
                            <span class="label store-green btn">已完成</span>
                        {/if}
                        </td>
                        <td>{$item['remark']}</td>
                        <td>
                            <a href="javascript:void(0);" class="storespan btn btn-xs" data-toggle="modal" data-target="#myModal{$item['id']}">
                                <span class="fa fa-trash-o"></span>
                                <span class="bianji">删除
                                    <span class="arrowdown"></span>
                                </span>
                            </a>
                        </td>
                    </tr>
                    <div class="modal fade" id="myModal{$item['id']}" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                        <div class="modal-dialog" role="document">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                    <h4 class="modal-title" id="myModalLabel" style="font-size: 20px;">提示</h4>
                                </div>
                                <div class="modal-body" style="font-size: 20px">
                                    确定删除么？
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                                    <a href="{php echo $this->createWebUrl('ordertime', array('op' => 'delete', 'id' => $item['id'],'carnum'=>$carnum))}" type="button" class="btn btn-info" >确定</a>
                                </div>
                            </div>
                        </div>
                    </div>
                    {/loop}
                    {if empty($list)}
                    <tr class="yg5_tr2">
                        <td colspan="8">
                            暂无订单信息
                        </td>
                    </tr>
                    {/if}
                </table>
            </div>
        </div>
    </div>
</div>
<div class="text-right we7-margin-top">
    {$pager}
</div>
<script type="text/javascript">
    $(function(){
        $("#frame-7").show();
        $("#yframe-7").addClass("wyactive");


        $(".allcheck").on('click',function(){
            var checked = $(this).get(0).checked;
            $("input[type=checkbox]").prop("checked",checked);
        });
    })
</script>